package com.jn.exam.exam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jn.exam.exam.entity.Exam;
import com.jn.exam.exam.entity.Student;
import com.jn.exam.exam.entity.Teacher;
import com.jn.exam.exam.entity.vo.ExamStudentVo;
import org.apache.ibatis.annotations.MapKey;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 江南大学1033190417
 * @since 2022-02-18
 */
public interface ExamMapper extends BaseMapper<Exam> {

    boolean registerForExam(Map<String, Object> param);

    List<String> getStudentExamIds(String studentId);

    List<Student> getAllStudentForExam(String examId);

    boolean saveExam(Exam exam);

    boolean addExamProctor(Map<String, Object> param);

    boolean addExamMarking(Map<String, Object> param);

    boolean removeProctor(String examId, String teacherId);

    boolean removeMarking(String examId, String teacherId);

    boolean removeMarkings(String examId);

    boolean removeProctors(String examId);

    boolean removeExamStudent(String examId);

    List<String> getExamIds(String teacherId);

    boolean leaveExam(String studentId, String examId);

    boolean removeViolation(String examId);

    boolean updatePaperStatus(String examId);

    List<Teacher> getProctorTeacher(String examId);

    List<Teacher> getMarkingTeacher(String examId);

    List<String> getMyMarkingExamIds(String teacherId);

    //按条件查询参加某考试的学生总数
    Integer getPageStudentForExamTotal(ExamStudentVo examStudentVo);

    //按条件查询参加某考试的学生信息
    List<Student> getPageStudentForExam(ExamStudentVo examStudentVo);

    Integer isAttendedForExam(Map<String, Object> param);

    boolean updateAttendFormExam(Map<String, Object> param);

    boolean cheatStudent(Map<String, Object> param);

    @MapKey("attend")
    List<Map<String, Object>> getAllStudentAttendStatusOfExam(String examId);

    List<String> getMyProctorExamIds(String teacherId);

    List<Map<String, Object>> queryNumberOfPerScore(String examId);
}
